package main

import (
	"encoding/json"
	"fmt"
	"time"
)

type MachineInfo struct {
	Name   string `json: "name"`
	Status int    `json: "status"`
}

func main() {
	fmt.Printf("## %d ##\n", 0x80>>0)
	fmt.Printf("## %d ##\n", 0x80>>1)
	fmt.Printf("## %d ##\n", 0x80>>2)
	fmt.Printf("## %d ##\n", 0x80>>3)
	fmt.Printf("## %d ##\n", 0x80>>4)
	fmt.Printf("## %d ##\n", 0x80>>5)
	fmt.Printf("## %d ##\n", 0x80>>6)
	fmt.Printf("## %d ##\n", 0x80>>7)
}

func test_array_point() {

	var a *[5]byte
	var b [5]byte

	a = &b

	fmt.Println(*a)
	a[0] = 0
	a[1] = 1
	a[2] = 3
	fmt.Println(*a)
}

func test_time() {
	TimeFormat := "2006-01-02 15:04:05"
	t := time.Now().Format(TimeFormat)
	fmt.Println(time.Now())
	fmt.Println(t)
}

func main_() {
	//go sayHello()
	//go sayWorld()
	//var str string
	//fmt.Scan(&str)
	//fmt.Println("Great  " + str)
	//fmt.Println(runtime.NumCPU())
	//fmt.Println(runtime.NumGoroutine())

	macInfo := MachineInfo{"01", 1}
	timestamp := time.Now().Unix()
	fmt.Println(timestamp)
	fmt.Printf("%1d\n", timestamp)
	ts_str := fmt.Sprintf("%1d", timestamp)
	fmt.Println(ts_str)

	str, err := json.Marshal(macInfo)
	if err == nil {
		fmt.Println(string(str))
	}
}
